from selenium import webdriver
from test_data.dengludata import url,sucess
from pageweb.denglu import PackLogin
def driver(txt='Chrome',islogin=True):
    try:
        driver=getattr(webdriver,txt)() #等同于webriver.chrome()
    except:
        driver=webdriver.Chrome()
    driver.get(url)#打开网页
    driver.maximize_window()#界面最大化
    driver.implicitly_wait(5)
    if islogin==True:
        PackLogin(driver).login(sucess['n'],sucess['p'],sucess['c'])#接受登陆数据
    return driver